package com.saydc.actions.capacitaciones;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.saydc.dao.CapacitacionesDAO;
import com.saydc.model.Capacitacion;

public class CapacitacionesNecesariasAction extends Action {
	
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		CapacitacionesDAO dao = CapacitacionesDAO.getInstance();
		List<Capacitacion> listaCapacitaciones = (List<Capacitacion>)dao.getAllCapacitaciones();
		request.getSession().setAttribute("listaCapacitaciones", listaCapacitaciones);
		return mapping.findForward("necesarias");
	}

}
